/*
Filename:    association_collection_const_iterator.cpp
Author:      Erik Öjebo
Date:        2009-01-10
Description: A const forward iterator for the class AssociationCollection.
*/

// See header for documentation

#include "association_collection_const_iterator.h"

AssociationCollectionConstIterator::
    AssociationCollectionConstIterator(AssociationCollection const * collection)
        : collection(collection)
{
    // Point the new iterator to the beginning of the collection:
    iterator = collection->listBegin();
}

bool AssociationCollectionConstIterator::isAtEnd() const
{
    // Has the iterator reached the end of the collection?
    return iterator == collection->listEnd();
}

void AssociationCollectionConstIterator::operator++(int i)
{
    iterator++;
}

const sctp_assoc_t& AssociationCollectionConstIterator::data() const
{
    // Return the data that the iterator points to:
    return (*iterator);
}
